<%@ page contentType="text/html;charset=GB2312" %>
<%@ page import="java.sql.*" %>
<HTML><HEAD><%@ include file="head.txt" %></HEAD>
<BODY background=image/back.jpg><font size=2>
<div align="center">
<%   try {  Class.forName("com.mysql.jdbc.Driver");
      }
      catch(Exception e){} 
      String uri="jdbc:mysql://127.0.0.1/shop?"+
                             "user=root&password=root&characterEncoding=gb2312";
      Connection con; 
      Statement sql;
      ResultSet rs;
      try {
        con=DriverManager.getConnection(uri,"root","root");
     sql=con.createStatement();
     String cdn=
         "SELECT * FROM cosmeticForm";
     rs=sql.executeQuery(cdn);
    String picture="welcome.jpg";
    String detailMess="";
     while(rs.next()){
       String number=rs.getString(1);
       String name=rs.getString(2);
       String maker=rs.getString(3);
       String price=rs.getString(4);
       detailMess=rs.getString(5);
       String ID=rs.getString(6);
       picture=rs.getString(7); 
         String pic ="<img src='image/"+picture+"' width=260 height=200 ></img>";
         out.print(pic);
         out.print("<br>");
         out.print(number);
         out.print("<br>");
         out.print(name);
         out.print("<br>");
         out.print(maker);
         out.print("<br>");
         out.print(price);
         out.print("<br>");    
     } 
     out.println("<div align=center>"+detailMess+"<div>");
     con.close();
     }
     catch(SQLException e){ 
        out.print(e);
     }
%>
</div></font>
</BODY></HTML>
